﻿using System;
using Autodesk.Revit.DB;

namespace YJKRevitDimensionText.OneKeyPlanDim.OutWallThreeDim
{
	public class CurveUtils
	{
		public static bool GetCurveProjectEndPoint(Curve cv, Curve cvProj, out XYZ ptEnd0, out XYZ ptEnd1)
		{
			ptEnd0 = null;
			ptEnd1 = null;
			try
			{
				Curve curve = cvProj.Clone();
				if (curve.IsBound)
				{
					curve.MakeUnbound();
				}
				ptEnd0 = cvProj.Project(cv.GetEndPoint(0)).XYZPoint;
				ptEnd1 = cvProj.Project(cv.GetEndPoint(1)).XYZPoint;
			}
			catch (Exception)
			{
				return false;
			}
			return true;
		}
	}
}
